package com.delivery.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单表(Orders)实体类
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Orders implements Serializable {

    // 订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消 7退款
    public static final int PENDING_PAYMENT = 1;
    public static final int PENDING_CONFIRMATION = 2;
    public static final int CONFIRMED = 3;
    public static final int DELIVERING = 4;
    public static final int DELIVERED = 5;
    public static final int CANCELED = 6;
    public static final int REFUNDING = 7;

    //支付状态 0未支付 1已支付 2退款
    public static final Byte UNPAID = 0;
    public static final Byte PAID = 1;
    public static final Byte REFUNDED = 2; // 退款

    private Long id;
    private String number;
    private Integer status;
    private Long userId;
    private Long addressBookId;
    private LocalDateTime orderTime;
    private LocalDateTime checkOutTime;
    private Integer payMethod;
    private Byte payStatus;
    private BigDecimal amount;
    private String remark;
    private String phone;
    private String address;
    private String userName;
    private String consignee;
    private String cancelReason;
    private String rejectionReason;
    private LocalDateTime cancelTime;
    private LocalDateTime estimatedDeliveryTime;
    private Byte deliveryStatus;
    private LocalDateTime deliveryTime;
    private Integer packAmount;
    private Integer tablewareNumber;
    private Byte tablewareStatus;
}